﻿<%@ Page Language="c#" Inherits="WinnerCMS.WebUI.Admin.Soft.Add" CodeBehind="Add.aspx.cs" %>

<!doctype html>
<html>
<head runat="server">
    <title>
        <%= AutoTitle() %></title>
    <meta charset="utf-8">
    <meta content="no-cache" http-equiv="Pragma" />
    <%: Scripts.Render("~/Scripts/AdminBase") %>
 
    <script src="../../Scripts/jquery.validate.min.js" type="text/javascript"></script>
     
    <script src="Add.js" type="text/javascript"></script>
    <%: Styles.Render("~/Content/Bootstrap/css") %>
      
    <script type="text/javascript">
        $(function ()
        {
            if ($("#hfDownList").val() != "")
            {
                var list = $.parseJSON($("#hfDownList").val()); 
                for (var i = 0; i < list.length; i++)
                {
                    if (i > 0)
                    {
                        ServersAdd(list[i]);
                    }
                    else
                    {
                        var tr = $('#DownLoadArea tbody tr:first')
                        tr.find("select").val(list[i].ServerID);
                        tr.find("input[name='FileName']").val(list[i].FileName);
                    }
                }
            }
        });
        function ServersAdd(info)
        { 
        var tr = $('#DownLoadArea tbody tr:first').clone(true);
            tr.find("input").removeAttr("id");

            $('#DownLoadArea tbody').append(tr);
            if (info != null)
            {

                tr.find("select").val(info.ServerID);
                tr.find("input[name='FileName']").val(info.FileName);
            }
            $('#DownLoadArea tbody tr:last td').append("<input type=\"image\" Text=\"\" src=\"../Images/del.gif\" onclick=\"deleteDownList(this)\" /><br />");
        }

        function deleteDownList(delButton)
        {
            if (confirm("您确定要删除？"))
            {
                $(delButton).parent().parent().remove();
            }
        }
 
    </script>
    <style type="text/css">
        .RowStyle
        {
            width: 100px;
            font-weight: bold;
            text-align: right;
        }
        #t_Content
        {
            width: 100%;
            float: left;
            border: 0;
            margin: 0;
            border-collapse: collapse;
        }
 
    </style>
</head>
<body>
    <form id="Form1" method="post" runat="server">
 
    <div id="tabs" class="easyui-tabs">
        
        <div id="A" title="常规属性">
            <table style="width:100%">
                <tr>
                    <td class="RowStyle">
                        <font color="#ff0000">*</font>名称：
                    </td>
                    <td>
                        <div class="input-group"><asp:TextBox ID="txtSoftName" runat="server" Width="250px" CausesValidation="True" CssClass="form-control" /><span class="input-group-btn">
                        <asp:Button ID="btnCheckSoftName" runat="server" Cssclass="btn btn-default" Text="重名检测" /></span></div>
                    </td>
                </tr>
                <tr runat="server" id="trSoftVersion">
                    <td class="RowStyle">
                        版本：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSoftVersion" runat="server" Width="131px" />
                    </td>
                </tr>
                <tr>
                    <td class="RowStyle">
                        <font color="#ff0000">*</font> 所属栏目：
                    </td>
                    <td>
                        <WinnerCMS:DropDownListX ID="ddlCategory" runat="server" CausesValidation="True">
                        </WinnerCMS:DropDownListX>
                    </td>
                </tr>
                <tr runat="server" id="trSpecialID">
                    <td class="RowStyle">
                        专题栏目：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSpecialID" runat="server">
                            <asp:ListItem Value="0">不属于任何专题</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trKey">
                    <td class="RowStyle">
                        <img src="../../Images/help.gif" alt="" width="16" height="16" title="如果要输入多关键字请用“|”分割" />关 键 字：
                    </td>
                    <td ><div class="input-group">
                        <asp:TextBox ID="txtKey" runat="server" Width="250px" CssClass="form-control"></asp:TextBox> 
                        <span class="input-group-btn"><input id="btnGetTag" type="button" onclick="GetTag()" class="btn btn-default" value="现有Tags" /></span></div>
                    </td>
                </tr>
                <tr runat="server" id="trSoftSize">
                    <td class="RowStyle">
                        <font color="#ff0000">*</font>大小：
                    </td>
                    <td>
                        <asp:TextBox ID="txtSoftSize" runat="server" Width="136px" CausesValidation="True"></asp:TextBox>
                        &nbsp; <a href="#" onclick="return ToSize(' KB')">KB</a> <a href="#" onclick="return ToSize(' MB')">
                            MB</a>
                    </td>
                </tr>
                <tr runat="server" id="trStars">
                    <td class="RowStyle">
                        &nbsp;评分等级：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlStars" runat="server">
                            <asp:ListItem Value="1">★</asp:ListItem>
                            <asp:ListItem Value="2">★★</asp:ListItem>
                            <asp:ListItem Value="3">★★★</asp:ListItem>
                            <asp:ListItem Value="4" Selected="True">★★★★</asp:ListItem>
                            <asp:ListItem Value="5">★★★★★</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trRunAtSystem">
                    <td class="RowStyle">
                        平台：
                    </td>
                    <td class="icheckboxStyle">
                        <asp:CheckBoxList ID="CBL_RunAtSystem" runat="server" RepeatDirection="Horizontal"
                            RepeatColumns="9" Width="100%">
                            <asp:ListItem Value="Win2008">Win2008</asp:ListItem>
                            <asp:ListItem Value="WinVista">WinVista</asp:ListItem>
                            <asp:ListItem Value="Win2003">Win2003</asp:ListItem>
                            <asp:ListItem Value="WinXP">WinXP</asp:ListItem>
                            <asp:ListItem Value="Win2000">Win2000</asp:ListItem>
                            <asp:ListItem Value="NT">NT</asp:ListItem>
                            <asp:ListItem Value="WinME">WinME</asp:ListItem>
                            <asp:ListItem Value="Win9X">Win9X</asp:ListItem>
                            <asp:ListItem Value="Dos">Dos</asp:ListItem>
                            <asp:ListItem Value="Linux">Linux</asp:ListItem>
                            <asp:ListItem Value="Unix ">Unix </asp:ListItem>
                            <asp:ListItem Value="Mac">Mac</asp:ListItem>
                            <asp:ListItem Value="ASP环境">ASP环境</asp:ListItem>
                            <asp:ListItem Value="PHP环境">PHP环境</asp:ListItem>
                            <asp:ListItem Value="CGI环境">CGI环境</asp:ListItem>
                            <asp:ListItem Value=".Net">.Net</asp:ListItem>
                        </asp:CheckBoxList>
                    </td>
                </tr>
                
                <tr>
                    <td class="RowStyle">
                        属性：
                    </td>
                    <td class="icheckboxStyle">
                       <BootStrap:CheckBox ID="cbkIncludePic" runat="server" Text='含图' />
                        <BootStrap:CheckBox ID="cbkIsSlide" runat="server" Text="幻灯片" />
                        <BootStrap:CheckBox ID="cbkAllowComment" runat="server" Text='允许评论' />
                        <BootStrap:CheckBox ID="cbkIsHeadline" runat="server" Text="头条" />
                        <BootStrap:CheckBox ID="cbkIsOnTop" runat="server" Text='置顶' />
                        <BootStrap:CheckBox ID="cbkIsElite" runat="server" Text='推荐' />
                        <BootStrap:CheckBox ID="cbkIsChecked" runat="server" Text="审核" />
                        <BootStrap:CheckBox ID="cbkIsDraft" runat="server" Text="稿件" />
                    </td>
                </tr>
            </table>
        </div>
        <div id="B" title="高级属性">
            <table class="table table-bordered table-condensed table-hover" id="table_B" runat="server">
                <tr runat="server" id="trBlackGuard">
                    <td class="RowStyle">
                        插件威胁：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlBlackGuard" runat="server">
                            <asp:ListItem Value="不详">不详</asp:ListItem>
                            <asp:ListItem Value="无流氓软件">无流氓软件</asp:ListItem>
                            <asp:ListItem Value="可选安装">可选安装</asp:ListItem>
                            <asp:ListItem Value="强制安装">强制安装</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trCopyrightType">
                    <td class="RowStyle">
                        授权形式：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCopyrightType" runat="server">
                            <asp:ListItem Value="免费版">免费版</asp:ListItem>
                            <asp:ListItem Value="共享版" Selected="True">共享版</asp:ListItem>
                            <asp:ListItem Value="试用版">试用版</asp:ListItem>
                            <asp:ListItem Value="演示版">演示版</asp:ListItem>
                            <asp:ListItem Value="注册版">注册版</asp:ListItem>
                            <asp:ListItem Value="破解版">破解版</asp:ListItem>
                            <asp:ListItem Value="零售版">零售版</asp:ListItem>
                            <asp:ListItem Value="OEM版">OEM版</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trSoftLanguage">
                    <td class="RowStyle">
                        语言：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlSoftLanguage" runat="server">
                            <asp:ListItem Value="英文">英文</asp:ListItem>
                            <asp:ListItem Value="简体中文" Selected="True">简体中文</asp:ListItem>
                            <asp:ListItem Value="繁体中文">繁体中文</asp:ListItem>
                            <asp:ListItem Value="多国语言">多国语言</asp:ListItem>
                            <asp:ListItem Value="其他语言">其他语言</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trSoftType">
                    <td class="RowStyle">
                        类别：</td>
                    <td>
                        <asp:DropDownList ID="ddlSoftType" runat="server">
                            <asp:ListItem Value="国产软件">国产软件</asp:ListItem>
                            <asp:ListItem Value="国外软件">国外软件</asp:ListItem>
                            <asp:ListItem Value="汉化补丁">汉化补丁</asp:ListItem>
                            <asp:ListItem Value="程序源码">程序源码</asp:ListItem>
                            <asp:ListItem Value="电影下载">电影下载</asp:ListItem>
                            <asp:ListItem Value="FLASH动画">FLASH动画</asp:ListItem>
                            <asp:ListItem Value="其他">其他</asp:ListItem>
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trAuthor">
                    <td class="RowStyle">
                        作者/开发商：
                    </td>
                    <td>
                        <asp:TextBox ID="txtAuthor" runat="server" Width="250px" />
                        
                        <input type="button" value="更多" onclick='AuthorMore();' class="btn btn-default" />
                        
                    </td>
                </tr>
                <tr runat="server" id="trEmail">
                    <td class="RowStyle">
                        信箱：
                    </td>
                    <td>
                        <asp:TextBox ID="txtEmail" runat="server" Width="250px" />
                        <input type="button" value="更多" onclick='EmailMore();' class="btn btn-default" />
                    </td>
                </tr>
                <tr runat="server" id="trHomepage">
                    <td class="RowStyle">
                        主页：
                    </td>
                    <td>
                        <asp:TextBox ID="txtHomepage" runat="server" Width="250px" />
                    </td>
                </tr>
                <tr runat="server" id="trDecompressPassword">
                    <td class="RowStyle">
                        解压密码：
                    </td>
                    <td>
                        <asp:TextBox ID="txtDecompressPassword" runat="server" Width="168px"></asp:TextBox> <input  type="button" value="更多" onclick='DecompressPasswordMore();'
                            class="btn btn-default" />
                         
                    </td>
                </tr>
                <tr runat="server" id="trDemoUrl">
                    <td class="RowStyle">
                        演示地址：
                    </td>
                    <td>
                        <asp:TextBox ID="txtDemoUrl" runat="server" Width="328px"></asp:TextBox>
                        &nbsp;&nbsp;&nbsp;请输入完整的URL
                    </td>
                </tr>
                <tr runat="server" id="trTemplateFileName">
                    <td class="RowStyle">
                        网页模板：
                    </td>
                    <td>
                        <asp:TextBox ID="txtTemplateFileName" runat="server" Width="250px"></asp:TextBox>
                        <input id="Button2" type="button" value="网页模板" onclick='GetTemplate();' class="btn btn-default" />
                    </td>
                </tr>
                <tr runat="server" id="trPicUrl">
                    <td class="RowStyle">
                        缩略图：
                    </td>
                    <td>
                        <asp:TextBox ID="txtPicUrl" runat="server" Width="250px"></asp:TextBox>
                        <input id="现有图片" type="button" value="现有图片" onclick='GetImage();' class="btn btn-default" /><asp:Button
                            ID="btnUpLoad" runat="server" Cssclass="btn btn-default" Text="上传" />
                        <br />
                        缩略图大小：
                        <asp:TextBox ID="txtPicW" runat="server" Width="60px" Text="240"></asp:TextBox>
                        *
                        <asp:TextBox ID="txtPicH" runat="server" Width="60px" Text="180"></asp:TextBox>
                        <BootStrap:CheckBox ID="cbkBiLi" runat="server" Checked="True" Text="按比例缩小" />
                    </td>
                </tr>
                <tr runat="server" id="trHits">
                    <td class="RowStyle">
                        初始下载次数：
                    </td>
                    <td>
                        <WinnerCMS:NumericTextBox ID="NtxtHits" runat="server" Width="85px">0</WinnerCMS:NumericTextBox>
                    </td>
                </tr>
                <tr runat="server" id="trUpDateTime">
                    <td class="RowStyle">
                        更新日期：
                    </td>
                    <td>
                        <asp:TextBox ID="txtUpDateTime" runat="server"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div id="C" title="下载地址">
            <table class="table table-bordered table-condensed table-hover">
                <tr runat="server" id="trBrief">
                    <td class="RowStyle">
                        内容摘要：
                    </td>
                    <td>
                        <asp:TextBox ID="txtBrief" runat="server" Height="120px" TextMode="MultiLine" Width="98%"></asp:TextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div id="D" title="摘要">
            <table class="table table-bordered table-condensed table-hover">
                <tr runat="server" id="trRank">
                    <td class="RowStyle">
                        下载等级：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlRank" runat="server">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr runat="server" id="trPointNum">
                    <td class="RowStyle">
                        扣除点数：
                    </td>
                    <td>
                        <WinnerCMS:NumericTextBox ID="NtxtPointNum" runat="server" Width="85px">0</WinnerCMS:NumericTextBox>
                    </td>
                </tr>
            </table>
        </div>
        <div id="E" title="权限设置">
            <asp:Table ID="T_DefinedFile" BorderWidth="0" CellPadding="2" CellSpacing="1" runat="server"
                EnableViewState="true">
            </asp:Table>
        </div>
        <table id="F" title="自定义" width="100%">
            <tr>
                <td class="RowStyle" style="vertical-align: top">
                    <font color="#ff0000">*</font>添加下载地址：
                </td>
                <td align="left">
                    <input type="button" onclick="ServersAdd(null)" value="添加新服务器组" class="btn btn-default" />
                    <br />
                    <table id="DownLoadArea">
                        <tbody>
                            <tr>
                                <td valign="middle">
                                    <asp:DropDownList ID="DownLoadServer" runat="server">
                                    </asp:DropDownList>
                                    &nbsp;<asp:TextBox ID="FileName" runat="server" Width="320px"></asp:TextBox>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </td>
            </tr>
        </table>
    </div>
    <table id="t_Content" class="table table-bordered table-condensed table-hover">
        <tr>
            <td colspan="2">
                <WinnerCMS:CKEditorControl ID="CC_Content" runat="server" Height="500px"></WinnerCMS:CKEditorControl>
            </td>
        </tr>
    </table>
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
            <td style="text-align: center">
                <asp:Button ID="btnSoftAdd" runat="server" Text="添加" CausesValidation="False" OnClick="btnSoftAdd_Click"
                    Cssclass="btn btn-default"></asp:Button>
                <asp:Button ID="btnSoftEdit" runat="server" Text="修改" CausesValidation="False" OnClick="btnSoftAdd_Click"
                    Cssclass="btn btn-default"></asp:Button>
            </td>
        </tr>
    </table>
    <asp:HiddenField ID="hfDownList" runat="server" />
    </form><div id="dialog-modal">
        <iframe id="dialog-modal-url" frameborder="0" scrolling="no"></iframe>
    </div>
</body>
</html>
